<!DOCTYPE html>
<%
if (locals.input && locals.input.id) {
  var title = '编辑文章『' + locals.input.title + '』';
} else {
  var title = '发布文章';
}
%>
<html>
<head>
  <meta charset="utf-8">
  <title><%= title %></title>
  <%- include('../inc/bootstrap.html') %>
</head>
<body>

<%- include('../inc/menu.html') %>

<div class="container-fluid">
  <div class="row">
    <div class="col-md-8 col-md-offset-2">
      <div class="panel panel-primary" style="margin-top: 20px;">
        <div class="panel-heading">
          <h3 class="panel-title"><%= title %></h3>
        </div>
        <div class="panel-body">
          <% if (locals.error) { %>
          <div class="alert alert-danger" role="alert">
            <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
            <%= error %>
          </div>
          <% } %>
          <form method="post" enctype="multipart/form-data">
            <div class="form-group">
              <label for="ipt-title">标题</label>
              <input type="text" class="form-control" name="title" id="ipt-title" placeholder="请填写标题" value="<%= (locals.input && locals.input.title || '') %>">
            </div>
            <div class="form-group">
              <label for="ipt-content">内容</label>
              <textarea class="form-control" name="content" id="ipt-content" placeholder="请填写内容" rows="10"><%= (locals.input && locals.input.content || '') %></textarea>
            </div>
            <button type="submit" class="btn btn-primary">保存</button>
          </form>
        </div>
      </div>
    </div>
  </div>
</div>

</body>
</html>